import request from '@/common/request.js'
export function getModelById(modelId) {
	return request.request(`wflow/wflow/model/detail/${modelId}`, {
		data: {},
	})
}

//获取流程实例表单数据
export function getInstanceFormData(instanceId) {
	return request.request(`wflow/wflow/process/form/data/by/${instanceId}`, {
		data: {},
	})
}

// 搜索人员
export function getUserDepts(userId) {
	return request.request(`wflow/oa/org/user/${userId}/dept`, {
		data: {},
	})
}

//审批流程人员
export function startProcess(code, params) {
	return request.request(`wflow/wflow/process/start/${code}`, {
		method: 'post',
		data: {
			...params,
		},
	})
}

// 审批流程-智能表单
export function startProcessWithAssociateForm(params) {
	return request.request(`wflow/wflow/doc/start-process`, {
		method: 'post',
		data: {
			...params,
		},
	})
}

// 查询组织架构树
export function getOrgTree(param) {
	return request.request(
		`wflow/oa/org/tree?type=${param.type}&deptId=${
			param.deptId ? param.deptId : ''
		}`,
		{
			data: {
				param,
			},
		}
	)
}

export function getSealOption(param) {
	return request.request(
		`office-platform/out/esign/querySealByOrgId?orgId=${param.orgId}`,
		{
			data: {},
		}
	)
}
